package Handler;

// 创建具体的处理器类
public class ConcreteHandler1 implements Handler {
    private Handler successor;  // 后继处理器



    public void handleRequest(Request request) {
        if (request.getLevel() == 1) {
            // 处理请求
            System.out.println("ConcreteHandler1 handled the request.");
        } else if (successor != null) {
            // 将请求传递给后继处理器
            successor.handleRequest(request);
        }
    }
}
